@@ -191,6 +191,10 @@ module Agents |
||
| 191 | 191 |
end |
| 192 | 192 |
|
| 193 | 193 |
def check_url(url, payload = {})
|
| 194 |
+ unless /\Ahttps?:\/\//i === url |
|
| 195 |
+ error "Ignoring a non-HTTP url: #{url.inspect}"
|
|
| 196 |
+ return |
|
| 197 |
+ end |
|
| 194 | 198 |
log "Fetching #{url}"
|
| 195 | 199 |
response = faraday.get(url) |
| 196 | 200 |
raise "Failed: #{response.inspect}" unless response.success?
|
@@ -254,7 +258,6 @@ module Agents |
||
| 254 | 258 |
incoming_events.each do |event| |
| 255 | 259 |
interpolate_with(event) do |
| 256 | 260 |
url_to_scrape = event.payload['url'] |
| 257 |
- next unless url_to_scrape =~ /^https?:\/\//i |
|
| 258 | 261 |
check_url(url_to_scrape, |
| 259 | 262 |
interpolated['mode'].to_s == "merge" ? event.payload : {})
|
| 260 | 263 |
end |